package com.futureCloudMOM.core.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.futureCloudMOM.core.base.service.impl.BaseServiceImpl;
import com.futureCloudMOM.core.domain.BasicGroup;
import com.futureCloudMOM.core.service.BasicGroupService;
import com.futureCloudMOM.core.mapper.BasicGroupMapper;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* 【Basic_Group】的数据库操作Service实现
*
* @author Administrator
* @since 2023-06-06 15:19:29
*/
@Service
public class BasicGroupServiceImpl extends BaseServiceImpl<BasicGroupMapper, BasicGroup> implements BasicGroupService{

    @Override
    public List<BasicGroup> getListByNameAndCode(BasicGroup basicGroup) {
        return list(new LambdaQueryWrapper<BasicGroup>()
        .eq(BasicGroup::getDeleted,0)
        .like(ObjectUtils.isNotEmpty(basicGroup.getName()),BasicGroup::getName,basicGroup.getName())
        .like(ObjectUtils.isNotEmpty(basicGroup.getCode()),BasicGroup::getCode,basicGroup.getCode())
        .orderByDesc(BasicGroup::getSysCreateTime)
        );
    }
}
